package cn.com.customer.manager.bean

import android.os.Parcel
import android.os.Parcelable

data class MsgBean(val smsId: String, val receiveMobile: String, val receiveName: String, val sendDate: String, var smsContent: String) : Parcelable {
    constructor(parcel: Parcel) : this(
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString()) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(smsId)
        parcel.writeString(receiveMobile)
        parcel.writeString(receiveName)
        parcel.writeString(sendDate)
        parcel.writeString(smsContent)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<MsgBean> {
        override fun createFromParcel(parcel: Parcel): MsgBean {
            return MsgBean(parcel)
        }

        override fun newArray(size: Int): Array<MsgBean?> {
            return arrayOfNulls(size)
        }
    }

}

data class MsgSendBean(val smsId: String, val sendMobile: String, val sendName: String, val sendDate: String, var smsContent: String) : Parcelable {
    constructor(parcel: Parcel) : this(
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString()) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(smsId)
        parcel.writeString(sendMobile)
        parcel.writeString(sendName)
        parcel.writeString(sendDate)
        parcel.writeString(smsContent)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<MsgSendBean> {
        override fun createFromParcel(parcel: Parcel): MsgSendBean {
            return MsgSendBean(parcel)
        }

        override fun newArray(size: Int): Array<MsgSendBean?> {
            return arrayOfNulls(size)
        }
    }

}

data class ReceivedList(val notReadCount: String, val notReadList: List<MsgBean>, val readList: List<MsgBean>)
data class MsgListInfo(val receivedList: ReceivedList, val sendList: List<MsgSendBean>)
data class MsgPlayBean(var receiveBean: MsgBean?, var sendBean: MsgSendBean?) : Parcelable {
    constructor(parcel: Parcel) : this(
            parcel.readParcelable(MsgBean::class.java.classLoader),
            parcel.readParcelable(MsgSendBean::class.java.classLoader)) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeParcelable(receiveBean, flags)
        parcel.writeParcelable(sendBean, flags)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<MsgPlayBean> {
        override fun createFromParcel(parcel: Parcel): MsgPlayBean {
            return MsgPlayBean(parcel)
        }

        override fun newArray(size: Int): Array<MsgPlayBean?> {
            return arrayOfNulls(size)
        }
    }
}

data class SendMsgInfo(var receiverList: MutableList<Mobile>, var smsContent: String)
data class Mobile(var mobile: String)